Redux, useSelector, useDispatch


用 hooks 取代 connect

connect => hooks
取資料: mapStateToProps => useSelector
更新資料: mapDispatchToProps => useDispatch

import { Provider, useSelector, useDispatch } from 'react-redux';
import { addTodo } from './action/todolist';







你可能感興趣的文章

七天帶你初探AR世界-Day 3

七天帶你初探AR世界-Day 3

string 類型的內建函式

string 類型的內建函式

Themeing Windows Terminal With Oh-My-Posh

Themeing Windows Terminal With Oh-My-Posh






留言討論